

package com.hazelcast.query.impl.predicates;

import com.hazelcast.query.Predicate;

/**
 * Defines a common contract for range-like predicates.
 */
public interface RangePredicate extends Predicate {

    /**
     * @return the attribute on which this range predicate acts.
     */
    String getAttribute();

    /**
     * @return the lower/left bound of this range predicate or {@code null} if
     * the predicate range is left-unbounded.
     */
    Comparable getFrom();

    /**
     * @return {@code true} if the predicate range is left-closed, {@code false}
     * otherwise.
     * <p>
     * Can't be {@code true} if the predicate range is left-unbounded.
     */
    boolean isFromInclusive();

    /**
     * @return the upper/right bound of this range predicate or {@code null} if
     * the predicate range is right-unbounded.
     */
    Comparable getTo();

    /**
     * @return {@code true} if the predicate range is right-closed, {@code false}
     * otherwise.
     * <p>
     * Can't be {@code true} if the predicate range is right-unbounded.
     */
    boolean isToInclusive();

}
